<cfset reserved_urls = " ">

<cfif len(trim(url.purl)) GT 0>
    <cfquery name = "qAvail" datasource="#request.dsn#">
    SELECT * FROM core_accounts
    WHERE username = '#url.purl#'
    </cfquery>
    
    <cfset isok = 0>
    
    <cfif qAvail.recordcount IS 0>
    	<cfif NOT reserved_urls CONTAINS url.purl>
	        <cfset isok = 1>
		</cfif>
    </cfif>
    
    <cfif isok IS 1>
        <div style="color: #006600; font-weight: bold;">This username is available</div>
    <cfelse>
        <div style="color: #FF0000; font-weight: bold;">Sorry, this username is taken</div>
    </cfif>
<cfelse>
        <div style="color: #FF0000; font-weight: bold;">Please enter a username</div>
</cfif>